import Clipboard from 'clipboard';
import Vue from 'vue';
export default {
  inserted(el, { value }) {
    let clipboard = new Clipboard(el, {
      text: function () { return value },
      action: function () { return 'copy' }
    })
    clipboard.on('success', function (e) {
      Vue.prototype.$message({
        message: '复制成功',
        type: 'success',
        duration: 1000
      });
      e.clearSelection();
    })
  }
};